<#include "/common/head.ftl">

<@showTitle title="${i18n.getMessage('teachingSubstitute')} > ${i18n.getMessage('list')}">
	<a href="#" onclick="cc('offering/showAddTeachingInterruption.sgt?offeringId=${(offering.id)!}')">${i18n.getMessage('add')}</a>
	- <a href="#" onclick="cc('offering/showInfoOffering.sgt?id=${(offering.id)!}')">${i18n.getMessage('offering')}</a>
</@showTitle>

<br/>


<#assign substitutes = offering.getInstructorInterruptions('SUBSTITUTE')>
<#assign cancels = offering.getInstructorInterruptions('CANCEL')>

<#assign taSubstitutes = offering.getTAInterruptions('SUBSTITUTE')>
<#assign taCancels = offering.getTAInterruptions('CANCEL')>

<#if (substitutes.size() > 0)>
	<p style="font-weight:bold">Instructor: Substitute</p>
	${request.setAttribute('interruptions', substitutes)}
	<@display.table id="listTable" name="interruptions" >
		<@display.column title="${i18n.getMessage('teacher')}" style="width:200px"><a href="#" onclick="cc('teacher/showInfoTeacher.sgt?id=${listTable.teacher.id!}')">${(listTable.teacher.fullName)!}</a></@display.column>
		<@display.column title="${i18n.getMessage('fromDate')}" style="width:70px">${(listTable.fromDate?date)!}</@display.column>
		<@display.column title="${i18n.getMessage('toDate')}" style="width:70px">${(listTable.toDate?date)!}</@display.column>
		<@display.column title="${i18n.getMessage('substituteTeacher')}" style="text-align:center"><a href="#" onclick="cc('teacher/showInfoTeacher.sgt?id=${listTable.substituteTeacher.id!}')">${(listTable.substituteTeacher.fullName)!}</a></@display.column>
		<@display.column title="${i18n.getMessage('comment')}" style="width:150px"><textarea disabled style="width:95%;height:50px;background-color:#FFFAFA">${(listTable.comment)!}</textarea></@display.column>
		<@display.column title="${i18n.getMessage('edit')}" style="width:25px;text-align:center"><img src="images/edit.gif" onclick="cc('offering/showEditTeachingInterruption.sgt?id=${listTable.id}')" style="cursor:pointer"/></@display.column>
		<@display.column title="${i18n.getMessage('delete')}" style="width:40px;text-align:center"><img src="images/delete.gif" onclick="if(confirm('${i18n.getMessage('dialog.delete')}')) { cc('offering/deleteTeachingInterruption.sgt?id=${listTable.id}&offeringId=${offering.id}'); }" style="cursor:pointer"/></@display.column>
	</@display.table>
</#if>

<br/>

<#if (cancels.size() > 0)>
	<p style="font-weight:bold">Instructor: Cancel</p>
	${request.setAttribute('interruptions', cancels)}
	<@display.table id="listTable" name="interruptions">
		<@display.column title="${i18n.getMessage('teacher')}" style="width:150px">${(listTable.teacher.fullName)!}</@display.column>
		<@display.column title="${i18n.getMessage('fromDate')}" style="width:70px">${(listTable.fromDate?date)!}</@display.column>
		<@display.column title="${i18n.getMessage('toDate')}" style="width:70px">${(listTable.toDate?date)!}</@display.column>
		<@display.column title="Makeup From Date" style="text-align:center">${(listTable.makeupFromDate?date)!}</@display.column>
		<@display.column title="Makeup To Date" style="text-align:center">${(listTable.makeupToDate?date)!}</@display.column>
		<@display.column title="${i18n.getMessage('comment')}" style="width:150px"><textarea disabled style="width:95%;height:50px;background-color:#FFFAFA">${(listTable.comment)!}</textarea></@display.column>
		<@display.column title="${i18n.getMessage('edit')}" style="width:25px;text-align:center"><img src="images/edit.gif" onclick="cc('offering/showEditTeachingInterruption.sgt?id=${listTable.id}')" style="cursor:pointer"/></@display.column>
		<@display.column title="${i18n.getMessage('delete')}" style="width:40px;text-align:center"><img src="images/delete.gif" onclick="if(confirm('${i18n.getMessage('dialog.delete')}')) { cc('offering/deleteTeachingInterruption.sgt?id=${listTable.id}&offeringId=${offering.id}'); }" style="cursor:pointer"/></@display.column>
	</@display.table>
</#if>

<br/>

<#if (taSubstitutes.size() > 0)>
	<p style="font-weight:bold">TA: Substitute</p>
	${request.setAttribute('interruptions', taSubstitutes)}
	<@display.table id="listTable" name="interruptions" >
		<@display.column title="${i18n.getMessage('teacher')}" style="width:150px">${(listTable.teacher.fullName)!}</@display.column>
		<@display.column title="${i18n.getMessage('fromDate')}" style="width:70px">${(listTable.fromDate?date)!}</@display.column>
		<@display.column title="${i18n.getMessage('toDate')}" style="width:70px">${(listTable.toDate?date)!}</@display.column>
		<@display.column title="${i18n.getMessage('substituteTeacher')}" style="text-align:center">${(listTable.substituteTeacher.fullName)!}</@display.column>
		<@display.column title="${i18n.getMessage('comment')}" style="width:150px"><textarea disabled style="width:95%;height:50px;background-color:#FFFAFA">${(listTable.comment)!}</textarea></@display.column>
		<@display.column title="${i18n.getMessage('edit')}" style="width:25px;text-align:center"><img src="images/edit.gif" onclick="cc('offering/showEditTeachingInterruption.sgt?id=${listTable.id}')" style="cursor:pointer"/></@display.column>
		<@display.column title="${i18n.getMessage('delete')}" style="width:40px;text-align:center"><img src="images/delete.gif" onclick="if(confirm('${i18n.getMessage('dialog.delete')}')) { cc('offering/deleteTeachingInterruption.sgt?id=${listTable.id}&offeringId=${offering.id}'); }" style="cursor:pointer"/></@display.column>
	</@display.table>
</#if>

<br/>

<#if (taCancels.size() > 0)>
	<p style="font-weight:bold">TA: Cancel</p>
	${request.setAttribute('interruptions', taCancels)}
	<@display.table id="listTable" name="interruptions">
		<@display.column title="${i18n.getMessage('teacher')}" style="width:150px">${(listTable.teacher.fullName)!}</@display.column>
		<@display.column title="${i18n.getMessage('fromDate')}" style="width:70px">${(listTable.fromDate?date)!}</@display.column>
		<@display.column title="${i18n.getMessage('toDate')}" style="width:70px">${(listTable.toDate?date)!}</@display.column>
		<@display.column title="Makeup From Date" style="text-align:center">${(listTable.makeupFromDate?date)!}</@display.column>
		<@display.column title="Makeup To Date" style="text-align:center">${(listTable.makeupToDate?date)!}</@display.column>
		<@display.column title="${i18n.getMessage('comment')}" style="width:150px"><textarea disabled style="width:95%;height:50px;background-color:#FFFAFA">${(listTable.comment)!}</textarea></@display.column>
		<@display.column title="${i18n.getMessage('edit')}" style="width:25px;text-align:center"><img src="images/edit.gif" onclick="cc('offering/showEditTeachingInterruption.sgt?id=${listTable.id}')" style="cursor:pointer"/></@display.column>
		<@display.column title="${i18n.getMessage('delete')}" style="width:40px;text-align:center"><img src="images/delete.gif" onclick="if(confirm('${i18n.getMessage('dialog.delete')}')) { cc('offering/deleteTeachingInterruption.sgt?id=${listTable.id}&offeringId=${offering.id}'); }" style="cursor:pointer"/></@display.column>
	</@display.table>
</#if>

<br/><br/>
